package com.xjk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Xjk
 */

@RestController
public class MyController {

    @Autowired
    DiscoveryClient client;

    @RequestMapping("/sayHI")
    public String sayHi(){
        return "hi";
    }

    @RequestMapping("/client")
    public String clientData(){
        List<String> service = client.getServices();
        System.out.println(service);
        return "service";
    }

}
